
#include <d2d1.h>
#include <d2d1helper.h>
#include <dwrite.h>
#include <wincodec.h>

#include "App.h"


// #ifndef Assert
// #if defined( DEBUG ) || defined( _DEBUG )
// #define Assert(b) do {if (!(b)) {OutputDebugStringA("Assert: " #b "\n");}} while(0)
// #else
// #define Assert(b)
// #endif //DEBUG || _DEBUG
// #endif
using namespace core;
using namespace core::app;

int WINAPI WinMain(
    HINSTANCE hInstance, 
    HINSTANCE hPreInstance,
    LPSTR lpCmdLine,
    int nShowCmd){

    WINBOOL flat = HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

    if (flat && SUCCEEDED(CoInitialize(NULL))){
        App app;
        if(!SUCCEEDED(app.Initialize())){
            return MessageBoxA(NULL, "error", "Notice", 0);
        }
        
        app.RunMessageLoop();
        app.Exit();
        CoUninitialize();
    }
    
    return 0;
}